#include<stdio.h>
#include<unistd.h>
int main()
{
  pid_t id=fork();
  if(id<0)
  {
    printf("创建子进程失败\n");
    perror("fork");
    return 1;
  }
  else if(id==0)
  {
    while(1) 
       printf("i am child process\n");
  }
  else 
  {
    while(1) 
         printf("i am parent process\n");
  }
  return 0;
}
